package com.six.work.servicesImpl;

import com.github.pagehelper.PageHelper;
import com.six.work.entity.Invitation;
import com.six.work.entity.Position;
import com.six.work.entity.ResView;
import com.six.work.entity.Responses;
import com.six.work.mapper.ResponsesMapper;
import com.six.work.services.ResponsesServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageInfo;

import java.util.List;

@Service
public class ResponsesServicesImpl implements ResponsesServices {
    @Autowired
    private ResponsesMapper responsesMapper;

    @Override  //多表关联
    public PageInfo<ResView> findAllResponses(Integer num) {
        PageHelper.startPage(num,8);
        List<ResView> list = responsesMapper.findAllResponses();
        PageInfo<ResView> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public Integer DelResByID(Integer responses_id) {
        return responsesMapper.DelResByID(responses_id);
    }

    @Override
    public Responses SelectResByID(Integer response_id) {
        return responsesMapper.SelectResByID(response_id);
    }

    @Override
    public String updateResState(Integer response_id) {
        return responsesMapper.updateResState(response_id);
    }

    @Override
    public String updateResState1(Integer response_id) {
        return responsesMapper.updateResState1(response_id);
    }

    @Override
    public List<ResView> SelectResByPosID(Integer post_id) {
        return responsesMapper.SelectResByPosID(post_id);
    }

    @Override  //新增
    public Integer insertRes(Responses responses) {
        return responsesMapper.insertRes(responses);
    }


}
